package util

import (
	"errors"
	"golang.org/x/net/html"
)

func GetAttribute(node *html.Node, attrName string) (attr string, err error) {
	for _, a := range node.Attr {
		if a.Key == attrName {
			attr = a.Val
			return
		}
	}

	err = errors.New("not found")
	return
}